﻿Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.OleDb
Imports DoAnQuanLyBanHang1065043_1065007.DoAnQuanLyBanHang.General

Namespace DoAnQuanLyBanHang.DTO
    Public Class QuyenData
        Private m_QuyenData As New DataService()

        Public Function LayQuyen() As DataTable
            Dim cmd As New SqlCommand("SELECT * FROM QUYEN")
            m_QuyenData.Load(cmd)
            Return m_QuyenData
        End Function

        Public Function ThemDongMoi() As DataRow
            Return m_QuyenData.NewRow()
        End Function

        Public Sub ThemQuyen(m_Row As DataRow)
            m_QuyenData.Rows.Add(m_Row)
        End Sub

        Public Function LuuQuyen() As Boolean
            Return m_QuyenData.ExecuteNoneQuery() > 0
        End Function

    End Class
End Namespace
